<?php require_once WEB_ROOT_FOLDER.'views/header.php';?>
<?php if(isset($_SESSION['access_level']) && ($_SESSION['access_level'] == 9)){?>
        <h4>Zarządzaj zakupami</h4>
        <?php
        if(isset($data['page']['content']) && is_array(($data['page']['content']))){
        ?>
        <table class="tight" cellspacing="0" cellpadding="0" >
            <thead class="alt first last">
                <tr>
                    <th value="email">Pole</th>
                    <th value="company_name">Wartość</th>                    
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        Adres witryny internetowej
                    </td>
                    <td>
                        <?php
                        if(isset($data['page']['content']['0']['1'])){
                            ?>
                        <?php echo $data['page']['content']['0']['1']; ?>
                        <?php
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        Wersja systemu
                    </td>
                    <td>
                        <?php
                        if(isset($data['page']['content']['0']['2'])){
                            ?>
                        <?php echo $data['page']['content']['0']['2']; ?>
                        <?php
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        Adres email
                    </td>
                    <td>
                        <?php
                        if(isset($data['page']['content']['0']['3'])){
                            ?>
                        <?php echo $data['page']['content']['0']['3']; ?>
                        <?php
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        Nazwa użytkownika
                    </td>
                    <td>
                        <?php
                        if(isset($data['page']['content']['0']['4'])){
                            ?>
                        <?php echo $data['page']['content']['0']['4']; ?>
                        <?php
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        Nazwa firmy
                    </td>
                    <td>
                        <?php
                        if(isset($data['page']['content']['0']['5'])){
                            ?>
                        <?php echo $data['page']['content']['0']['5']; ?>
                        <?php
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        Numer VAT
                    </td>
                    <td>
                        <?php
                        if(isset($data['page']['content']['0']['6'])){
                            ?>
                        <?php echo $data['page']['content']['0']['6']; ?>
                        <?php
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        Inne informacje
                    </td>
                    <td>
                        <?php
                        if(isset($data['page']['content']['0']['7'])){
                            ?>
                        <?php echo $data['page']['content']['0']['7']; ?>
                        <?php
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        Adres firmy
                    </td>
                    <td>
                        <?php
                        if(isset($data['page']['content']['0']['8'])){
                            ?>
                        <?php echo $data['page']['content']['0']['8']; ?>
                        <?php
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        Płatnik VAT
                    </td>
                    <td>
                        <?php
                        if(isset($data['page']['content']['0']['9'])){
                            ?>
                        <?php echo $data['page']['content']['0']['9']; ?>
                        <?php
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        Data utworzenia
                    </td>
                    <td>
                        <?php
                        if(isset($data['page']['content']['0']['10'])){
                            ?>
                        <?php echo $data['page']['content']['0']['10']; ?>
                        <?php
                        }
                        ?>
                    </td>
                </tr>
            </tbody>
        </table>
        <?php
        }
        ?>
        <fieldset class="col_12 column">
            <legend>Zmień status zamównienia</legend>
            <form method="post" action="<?php echo SITE_ROOT;?>zarzadzaj-zamowieniami/aktualizuj-zamowienie.html">
                <input type="hidden" name="id" value="<?php if(isset($data['page']['content']['0']['0'])){ echo $data['page']['content']['0']['0']; }?>">
                <input name="csrf_token" type="hidden" value="<?php if(isset($data['page']['csrf_token'])){ echo $data['page']['csrf_token']; }?>">
                <label class="col_12 column" for="status_name">
                    Wybierz nowy status zamówienia
                </label>
                    <?php
                    if(isset($data['page']['account_statuses'])){
                ?>
                <select name="status_name" class="col_12 column">
                <?php
                    foreach($data['page']['account_statuses'] as $key => $value){
                        if(isset($value['0'])){
                            if(isset($data['page']['content']['11']) && ($data['page']['content']['11'] == $value['0'])){
                                ?>
                    <option value="<?php echo $value['0'];?>" selected="selected"><?php echo $value['0'];?></option>
                    <?php
                            }
                            else {
                                ?>
                    <option value="<?php echo $value['0'];?>"><?php echo $value['0'];?></option>
                    <?php
                            }
                        }
                    }
                    ?>
                    <?php
                }
                ?>
                    <input type="submit" value="Aktualizuj zamówienie" name="aktualizuj-zamowienie">
            </form>
        </fieldset>
        <!--<a href="<?php echo SITE_ROOT;?>zarzadzaj-modulami/dodaj-modul.html" title="Dodaj nowy modul">Dodaj nowy moduł</a>-->
<?php } ?>
<?php require_once WEB_ROOT_FOLDER.'views/footer.php'; ?>

